package com.ruoyi.mapper;

import com.ruoyi.domain.UserData;
import com.ruoyi.dto.BasisLoadingPositionEquipmentUser;
import com.ruoyi.dto.BasisPositionFrequencyConverterUser;
import com.ruoyi.dto.BasisPositionReceiverUser;
import com.ruoyi.dto.BasisPositionResourceInfoUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 人员Mapper接口
 *
 * @author wangzebing
 * @date 2025-05-16
 */
public interface UserDataMapper {


    //根据阵地id查询 人员
    List<UserData> findByPositionId(@Param("positionId") Long positionId,@Param("loadingId") String loadingId);

    List<UserData> findByPositionIdXueyuan(@Param("positionId") Long positionId,@Param("loadingId") String loadingId,@Param("userId") String userId);


    //根据案例id查询 人员
    List<UserData> findByLoadingIdFormUser(@Param("loadingId") String loadingId);
    //新 根据案例id查询 人员

    List<UserData> findByLoadingIdFormUserResource(@Param("loadingId") String loadingId);

    //根据案例id和人员id查询 人员信息
    List<UserData> findByLoadingIdAndUserIdFormUserResource(@Param("loadingId") String loadingId,@Param("userId") Long userId);


    //添加阵地与人员 关联表
    boolean addBasisPositionUser(UserData userData);

    //添加设备关联人员
    boolean addBasisLoadingPositionEquipmentUser(BasisLoadingPositionEquipmentUser basisLoadingPositionEquipmentUser);

    //新 添加设备关联人员
    boolean addBasisLoadingPositionResourcesUser(BasisPositionResourceInfoUser basisPositionResourceInfoUser);
    boolean addBasisPositionFrequencyConverterUser(BasisPositionFrequencyConverterUser basisPositionFrequencyConverterUser);

    boolean addBasisPositionReceiverUser(BasisPositionReceiverUser basisPositionReceiverUser);

    List<UserData> findByBasisPositionEquipmentUser(@Param("loadingId") String loadingId,@Param("positionId") Long positionId,@Param("equipmentId") Long equipmentId);
    //根据案例阵地人员id查询  设备关联
    List<Map<String,Object>> findByBasisPositionUserEq(@Param("loadingId") String loadingId, @Param("positionId") Long positionId);
    //新 根据案例阵地人员id查询  设备关联
    List<Map<String, Object>> findByBasisPositionUserResource(@Param("loadingId") String loadingId, @Param("positionId") Long positionId);

    //根据案例阵地天线id 删除天线下关联的人员
    boolean delbasisPositionEquipmentUserEqid(@Param("loadingId") String loadingId,@Param("positionId") Integer positionId,@Param("eqId") Integer eqId);

    //根据案例id 阵地id  人员id  删除阵地下对应的人员
    boolean delBasisPositionUser(@Param("loadingId") String loadingId,@Param("positionId") Integer positionId,@Param("userId") Integer userId);
    //根据案例id 阵地id  人员id  删除人员绑定的设备
    boolean delBasispositionEquipmentUser(@Param("loadingId") String loadingId,@Param("positionId") Integer positionId,@Param("userId") Integer userId);

    boolean delBasisPositionUser2(@Param("loadingId") String loadingId,@Param("positionId") Integer positionId);

    //清除演训结果
    boolean delbasisPositionEquipmentUserByLoadingId(@Param("loadingId") String loadingId);


}
